Following are the built-in functions supported by the Xtend IVR engine.
The activeCalls() function obtains the number of calls active in the dialed line.
Syntax
$numInteger = ActiveCalls(<dli>)
The activePorts() function obtains the number of ports being monitored by the IVR.
Syntax
$numInteger = ActivePorts()
The alltrim() function trims all the leading and trailing white-space characters, tabs, carriage return and line feed from the string parameter and returns trimmed string.
Syntax
$trimmedString = alltrim(<string>)
The ascii() function returns the ASCII code of the character entered.
Syntax
$asciiCode = ascii(<character>)
AtomicAdd() function increments the value of a variable in a particular device.
Syntax
AtomicAdd(<deviceId>, <$variable>, <value>)
AtomicGet() function gains access to the variables across devices.
Syntax
$valueString = AtomicGet(<deviceId>, <$variable>)
AtomicSet() function sets the value of a variable in a particular device.
Syntax
AtomicSet(<deviceId>, <$variable>, <value>)
The BlindTransfer() function blindly transfers the call to the particular extension phone.
Syntax
$statusBoolean = BlindTransfer(<extensionNumber>)
The Calls() function obtains the number of calls handled by the current port.
Syntax
$numInteger = Calls(<dli>)
The chr() function will return the character if given its ASCII code.
Syntax
$character = chr(<number>)
ComClose() closes the serial port communication connection.
Syntax
ComClose()
ComOpen() establishes a connection with the serial port.
Syntax
ComOpen("<Communication Port>", "<BaudRate> <Parity, Databits, Stopbits> <FlowControl>",)
ComRead() reads data from the serial port.
Syntax
$buffer = ComRead(<Size>, <Timeout>)
ComReadLine() reads a single line of data from the serial port.
Syntax
$buffer = ComReadLine(<Timeout>)
ComReadSize() finds out the size of the data in the serial port that are ready to be read.
Syntax
$size = ComReadSize()
ComWrite() writes data to the serial port.
Syntax
comWrite(<buffer>)
ComWriteLine() writes a line of data to the serial port.
Syntax
ComWriteLine(<buffer>)
The compare() function will compare two strings.
Syntax
$integer = compare(<String1>, <String2>)
The concat() function will return a copy of the string after appending all given strings (<string1>, <string2>, ....).
Syntax
$concatenatedString = concat(<string1>, <string2>, ....)
Convert() is used to convert the wave file into the specified wave format and saves it in a separate file.
Syntax:
$status = wave.Convert ("<Source Filename >","<Codec>","[Target Filename]")
CountMessage() returns the total number of messages present in the message queue of the specified device.
Syntax:
$TotalMsg = CountMessage([DeviceId])
The Datasize() function returns the data size of the wave file.
Syntax:
$size = wave.datasize ("<Wavefile>","[Compr]")
DeleteFile() function deletes the specified file and returns boolean value true if file deleted, false otherwise.
Syntax
$boolean = DeleteFile(<filename>)
DeviceSpecific() executes a function unique to a specific driver.
Syntax
DeviceSpecific(<functionName>[, parameters])
Dial() makes an outgoing call.
Syntax
$bool = Dial(<Phone Number>)
The Encrypt() function is to encrypt the wave file using the encryption type BLOWFISH or XOR.
Syntax
$bool = wave.Encrypt ("<Wave Filename>","<Password>","<Type>","[Destination File]")
Escape() function converts the binary characters in the string to its percentage(%) hexa form.
Syntax
$escapedString = Escape(<string>)
The ExtractXmlTag() function is used to retrieve the text in which the tag should be searched for and returns the text as per the specified offset value.
Syntax:
$xmltext = ExtractXmlTag ( <xmldata>, <starting tag>, <ending tag>, [offset] )
The Find() function finds a character or substring inside a larger string and returns the zero-based index of the first character in the 'Master string'.
Syntax
$index = Find(<Master string>, <Sub string>, [Offset])
Format() function writes formatted data to a string.
Syntax
$formattedString = Format(fcString [,arguments]..)
Fraction() function returns the fractional portion of the number.
Syntax
$numericInteger = Fraction(<number>)
The Get() function is to get specific web page.
Syntax
$Page = http.Get("<URL>")
The GetCallProgress() function obtains the current status of a Dial() or Transfer() operation.
Syntax
$statusString = GetCallProgress()
The Get2File() is to get specific web page into a file.
Syntax
$Status = http.Get2File("<URL>","<Filename>")
The GetInfo() function retrieves information from the driver DLL.
Syntax
$infoString = GetInfo(<attribute>)
GetMessage() function fetches a string from the message queue of the specified device.
Syntax
$msgString = GetMessage(<deviceId>)
The GetStartTime() function generates the starting date and time of the IVR.
Syntax
$dateTime = GetStartTime()
The GetTag() function is used to retrieve the remark attached to a tag/label within the wave file.
Syntax
$bool=wave.GetTag ("<Wave Filename>","<Tag>")
The GetTickCount() retrieves the number of milliseconds that have elapsed since the system had started.
Syntax
$intCount = GetTickCount()
The GetTime() function fetches the local date and time.
Syntax
$dateTime = GetTime()
The hashoffile() function gives the hash value of any type of file.
Syntax
$hash = md5.hashoffile("<filename>")
The hashofstring() function gives the hash value of specified string.
Syntax
$hash = md5.hashofstring ("<String>")
The hashofwavedata() function gives the hash value of of wave file.
Syntax
$hash = md5.hashofwavedata("<Wavefile>")
Index() function returns the zero-based index of a substring or a character inside a larger string. If sub string or character is not found, it will return -1. Index function has the same syntax as that of Find() function.
Syntax
$index = Index(<Master string>, <Sub string>)
The init() function is used to initialize the specific port in order to send and receive data.
Syntax
udp.init("<Port>")
The input() function will accept numbers entered on the dial-pad by the user.
Syntax
$inputKey = input(<max digits>, [wait in seconds], [enter key], [esc key], [mask])
Integer() function returns the integral part of the number.
Syntax
$numericInteger = Integer(<number>)
IsVariable() function searches for the given variable anywhere inside the script and returns 1 if present, 0 otherwise.
Syntax
$boolean = IsVariable("$variable")
The len() function will return the length of the <string>.
Syntax
$length = len(<string>)
The left() function will return the leftmost length of the <string>.
Syntax:
$LeftString = left(<string>, <len>)
LoadFile() function loads the specified number of lines of text from the file to a variable.
Syntax
$boolean = LoadFile(<filename>, <$variable>, <NoOfLines>)
Lock() function permits one and only one script to execute inside a block of statements.
Syntax
Lock(<name>)
The Loudness() function gives the maximum frequency of the wave within the given block size.
Syntax
$val = wave.loudness ("<Wave Filename >",[Block Size],"[Freqstoignore]")
The lower() function will return a copy of the <string> converted to lowercase.
Syntax
$lowerCaseString = lower(<string>)
The ltrim() function will return a copy of the <string> after removing all the leading spaces.
Syntax
$leadingSpaceTrimmedString = ltrim(<string>)
The Merge() function merges two waves and store it in the specified location.
Syntax
$stat = wave.merge ("<Wavefile1>","<Wavefile2>","<Destination Filename>")
Mid() function extracts a substring of length [len] characters from <string>.
Syntax
$extractedString = mid(<string>, <start index>, [len])
PlayTimeLeft() function returns the pending play back time in milliseconds.
Syntax
$timeInteger = PlayTimeLeft()
PutMessage() function places a string into the message queue of the specified device.
Syntax
PutMessage(<deviceId>, <string>)
The receive() function used to receive UDP data from a specific UDP port
Syntax
udp.receive("<Timeout>")
The RecordTimeLeft() function returns the remaining time for recording.
Syntax
$timeInteger = RecordTimeLeft()
The Reverse() function reverses a given string.
Syntax:
$index = Reverse(<Master string>, <Sub string>)
The ReverseFind() function finds a character or substring inside a larger string starting the search from the end.
Syntax
$index = ReverseFind(<Master string>, <Sub string>)
The right() function will return the rightmost length of the <string>.
Syntax:
$RightString = right(<string>, <len>)
Rindex() function returns the zero-based index of a substring or a character inside a larger string starting the search from the end. Rindex() has the same syntax as that of ReverseFind() function.
Syntax
$index = Rindex(<Master string>, <Sub string>)
The rtrim() function will return a copy of the <string> after removing all the trailing whitespaces.
Syntax
$trailingSpaceTrimmedString = rtrim(<string>)
SaveFile() function replaces the content from the variable with that of the file by the specified number of lines.
Syntax
$boolean = SaveFile(<filename>, <$variable>, <NoOfLines>)
The seconds() function gives the time elapsed in seconds after the process has started.
Syntax
$timePeriod = seconds()
The send() function sends data to the UDP port of the specified IP address.
Syntax
udp.send("<IP>",<Port>,"<Data>")
The SetInfo() function sets the attribute of the driver.
Syntax
SetInfo(<attribute>, <value>)
The SetTag() Used to add a tag/label within the wave file.
Syntax
$bool=wave.SetTag ("<Wave Filename>","<Tag>","<Remark>")
The SetVariable() function changes the scope of the variable from local to global and assigns value to all instances of the variable.
Syntax
SetVarInVar(<variable>, <value>)
SoftDisconnect() function destroys a softInterconnect with a specified device.
Syntax
SoftDisconnect(<deviceId>)
SoftInterConnect() function interconnects the current device and the specified device.
Syntax
SoftInterConnect(<deviceId>)
SoftListen() function listens to a particular channel.
Syntax
SoftListen(<deviceId>[, Type])
SoftStream() function streams the Incoming, Outgoing or both audio of the current device to the incoming audio of the specified device.
Syntax
SoftStream(<deviceId>[, Type])
SoftUnlisten() function unlistens from the specified device.
Syntax
SoftUnlisten(<deviceId>)
SoftUnstream() function releases SoftStream() to the specified device.
Syntax
SoftUnstream(<deviceId>)
The srAcceptWords() function defines the grammar for the subsequent Input() operation.
Syntax
srAcceptWords(<word 1>, <word 2>, ..., <word N>)
The srAudio() function specifies when the audio play back has to be stopped.
Syntax
srAudio (<type>)
The srConfidence() function determines the level of recognition for the words/ grammar defined.
Syntax
$levelInteger = srConfidence()
The srGrammar() function loads grammar for speech recognition in the script.
Syntax
srGrammar(<fileName>)
or
srGrammar(<actualXmlText>)
The srKeepGrammar() function sets the grammar for the subsequent Input() operation in the script.
Syntax
srKeepGrammar(<boolean>)
SubStr() function extracts a substring from a larger string and has the same syntax as that of mid() function.
Syntax
$extractedString = substr(<string>, <start index>, [len])
The TotalCalls() function obtains the total number of calls handled by the IVR so far.
Syntax
$numInteger = TotalCalls()
The Transfer() function transfers the call to an extension phone.
Syntax
$statusString = Transfer(<extensionNumber>, <timeout>)
The Type() function returns the type of the wave file.
Syntax
$val = wave.type ("<Wavefile>")
The upper() function will return a copy of the <string> converted to uppercase.
Syntax
$upperCaseString = upper(<string>)
The UnEscape() function reverses the Escape() process.
Syntax
$unEscapedString = UnEscape(<string>)
The UnLock() function releases the last Lock() operation.
Syntax
UnLock()